﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using Common;

namespace Betfairer
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        //[STAThread]
        static void Main()
        {
            string[] acc = System.IO.File.ReadAllLines(@"d:\bf\acc.txt");
            Global.Instance.Login(acc[0], acc[1]);

            //TableDao tableDao = new TableDao();
            //tableDao.GetTable(107116529);

            //Utils.PrintDictionary(Utils.CalculateMarketsFrequencies(1));

            ////Console.WriteLine(result);
            ////Console.WriteLine();

            //foreach (BetfairGlobal.EventType eventType in Global.Instance.GetEventTypes())
            //{
            //    Console.WriteLine(eventType.id + " " + eventType.name);
            //}


            Scanner scanner = new Scanner();
            scanner.Start(1, 5, 5000);
            ////scanner.Start(1, 1, 7000, 5000, -1, -1);



            //List<Market> markets = Global.Instance.GetMarkets(1, DateTime.Today, DateTime.Today.AddDays(1));

            //Market choice = null;
            //foreach (Market market in markets)
            //{
            //    if (market.MarketId == 106983861)
            //    {
            //        choice = market;
            //        break;
            //    }
            //}

            //Console.WriteLine(choice);
            //Console.WriteLine((choice.EventDateMs - Utils.Now) / 1000 / 60);

            //Table table = new Table(Global.Instance.GetOdds(107077524));

            //Console.WriteLine(table);
            //Console.WriteLine(table.AsLine);
            //Console.WriteLine(Utils.TableIsFull(table));


            while (true)
            {
                System.Threading.Thread.Sleep(10000);
            }
        }
    }
}
